<?php if(!IS_AJAX){?>
<include file="Public:header" /><include file="Public:navgation" />
<style>.categorybtn{border-radius:0; margin:0; border:none;}
    .categorybtn.on{background:#fff; color:#47AEC8;}
</style>
<div class="container-fluid main-content">
  <div class="page-title chart-container"> </div>
  <div class="row">
      <div class="col-md-3 col-sm-4">
          <if condition="!isMobile()">
              <div class="widget-container" style="margin:0;padding:0">
                  <div class="heading">
                      <form role="form" method="post" action="{:U('Mission/index')}" class="checkoutform">
                          <div class="form-group opacity">
                              <div class="panel">
                                  <div class="panel-heading">
                                      <div class="panel-title">
                                          <a class="accordion-toggle collapsed" data-parent="#accordion" data-toggle="collapse" href="#faq1" style="font-size:14px">
                                              <div class="caret pull-right"></div>
                                              表单审批状态</a>
                                      </div>
                                  </div>
                                  <div class="panel-collapse collapse" id="faq1">
                                      <div class="panel-body" style="font-size: 14px;">
                                          <label class="radio" style=" margin-bottom:5px; margin-right:15px;"><input value="99" name="status" type="radio" nullmsg="" datatype="*" errormsg="" checked="checked"><span>全部</span></label>
                                          <label class="radio" style=" margin-bottom:5px; margin-right:15px;"><input value="0" name="status" type="radio" nullmsg="" datatype="*" errormsg="" <eq name="status" value="0">checked="checked"</eq>><span>驳回</span></label>
                                          <label class="radio" style=" margin-bottom:5px; margin-right:15px;"><input value="1" name="status" type="radio" nullmsg="" datatype="*" errormsg="" <eq name="status" value="1">checked="checked"</eq>><span>待审核</span></label>
                                          <label class="radio" style=" margin-bottom:5px; margin-right:15px;"><input value="2" name="status" type="radio" nullmsg="" datatype="*" errormsg="" <eq name="status" value="2">checked="checked"</eq>><span>审核中</span></label>
                                          <label class="radio" style=" margin-bottom:5px; margin-right:15px;"><input value="3" name="status" type="radio" nullmsg="" datatype="*" errormsg="" <eq name="status" value="3">checked="checked"</eq>><span>已通过</span></label>
                                      </div>
                                  </div>
                              </div>
                          </div>
                          <hr>
                          <div class="form-group">
                              <label for="email">搜索关键词</label>
                              <input class="form-control" id="keywords" name="keywords" value="{$keywords}" placeholder="审批名称或姓名" type="text">
                          </div>
                          <hr>
                          <div class="form-group">
                              <div class="row">
                                  <div class="col-sm-12 col-xs-12" style="margin:0;padding:0"><input class="form-control" id="starttime" name="starttime" readonly onClick="WdatePicker();" style="cursor:pointer;" value="{$starttime}" placeholder="起始时间" type="text"></div>
                              </div>
                              <div class="row">
                                  <div class="col-sm-12 col-xs-12" style="margin:0;padding:0"><input class="form-control" id="endtime" name="endtime" onClick="WdatePicker();" readonly style="cursor:pointer;" value="{$endtime}" placeholder="结束时间" type="text"></div>
                              </div>
                          </div>
                          <hr>
                          <div class="form-group">
                              <div class="col-md-12"  style="margin:0;padding:0">
                                  <select class="form-control" name="pagesize" style="display:inline;width:50%;margin-right:15px;">
                                      <option value="10" <eq name="pagesize" value="10">selected="selected"</eq>>每页10条</option>
                                      <option value="25" <eq name="pagesize" value="25">selected="selected"</eq>>每页25条</option>
                                      <option value="50" <eq name="pagesize" value="50">selected="selected"</eq>>每页50条</option>
                                      <option value="100" <eq name="pagesize" value="100">selected="selected"</eq>>每页100条</option>
                                  </select>
                                  <button class="btn btn-sm btn-info pull-right" style="margin:0;padding:5px 15px;border-radius:0">点击搜索</button>
                              </div>
                          </div>
                      </form>
                  </div>
              </div>
              <else />
          </if>
      </div>
    <div class="col-md-9 col-sm-8">
      <div class="widget-container">
        <div class="heading hidden-xs"> <i class="icon-bar-chart"></i> <span class="pagetitle">审批管理</span></div>
          <div class="DataListItembg " style="margin-top:4px; padding:0;">
              <a class="btn btn-info categorybtn listajaxrequest on" href="javascript:void(0);" rel="{:U('')}">全部</a><volist name='candy' id='candy'><a class="btn btn-info categorybtn listajaxrequest" href="javascript:void(0);" rel="{:U('',array('id'=>$candy['id']))}">{$candy.name}({$candy.count})</a>
              </volist>
          </div>
        <div class="DataList CustomerList">
          <?php }?>
          <volist name="list" id="vo">
            <div class="DataListItem DataListItembg item{$vo.id}" style="margin-top:4px; padding:0 5px;">
              <div class="row">
                <div class="col-sm-6 col-xs-12">
                  <div class="widget-content padded">
                    <h4 style="margin:0; font-size:16px; font-weight:bold; padding:5px 0;">{$vo.title}</h4>
                    
                    
                    <p>编号：{$vo.record}</p>
                    <p>审请人：{$vo.proposername}</p>
                    <p>审批人：{$vo.approvername}</p>
                    <p>提交时间：{:date('Y-m-d H:i:s', $vo['createtime'])}</p>
                    <p>状态：
                    <eq name="vo['state']" value="0">
                        <span class="label label-danger">驳回</span>
                    </eq>
                    <eq name="vo['state']" value="1">
                        <span class="label label-warning">未审批</span>
                    </eq>
                    <eq name="vo['state']" value="2">
                        <span class="label label-info">审批中</span>
                    </eq>
                    <eq name="vo['state']" value="3">
                        <span class="label label-success">通过</span>
                    </eq>
                    </p>
                  </div>
                </div>
                <div class="col-sm-6 col-xs-12 hidden-xs" style="text-align:right;">
                   <div class="optionBtnBox">
                        <a class="button" href="#window" onClick="_openWindow('{:U('read', array('id' => $vo['id']))}', 500, '{$vo.title}(查看)', '确认', null, '');">
                            <i class="icon-eye-open"></i> 查看
                        </a>
                        <a class="button" href="#window" onClick="_openWindow('{:U('schedule', array('id' => $vo['id']))}', 500, '{$vo.title}(审批记录)', '确认', null, '');">
                            <i class="icon-eye-open"></i> 审批记录
                        </a>
                  		
                   </div>
                </div>
              </div>
              <div class="BottomOptionBtn hidden"><a class="button" href="#window" onClick="_openWindow('{:U('read', array('id' => $vo['id']))}', 500, '{$vo.title}(审批)', '确认', null, '');"><i class="icon-eye-open"></i> 查看</a>
              
              <a class="button" href="#window" onClick="_openWindow('{:U('schedule', array('id' => $vo['id']))}', 500, '{$vo.title}(审批记录)', '确认', null, '');">
                            <i class="icon-eye-open"></i> 审批记录
                        </a>
              
              
               </div>
            </div>
          </volist>
          <?php if(!IS_AJAX){?>
        </div>
        <div class="loading hidden">正在加载</div>
        <div class="PagesBox"><?php echo $pages;?></div>
      </div>
    </div>
  </div>
</div>

<script>
    $.cookie('loadIndexUrl', window.location.href, {path:'/'});
    $(".checkoutform:eq(0)").Validform({
        ajaxPost:true,
        tiptype:function(data,s){
            if(s.type == 1){
                //$.ThinkBox.success(data,{'delayClose':0, 'close': '关闭'});
            }
        },
        datatype:{
            "text":function(gets,obj,curform,regxp){
                return true;
            },"image":function(gets,obj,curform,regxp){
                return true;
            }
        },
        callback:function(data){
            //检测登录
            $('.ThinkBox-close').trigger('click');
            if(data.status == 0){
                
            }else{

                //更新列表
                updateList();

            }
        }
    });

    function mission_send(id,e){
        if(!confirm('确定递交吗？')){
            return false;
        }
        hideLayer();
        $.post('{:U('send')}', {id:id}, function(data){
            if(data.status == 1){
                updateList();
            }else{
                alert(data.info);
            }
        }, 'json');
    }

    function mission_cancel(id,e){
        if(!confirm('确定取消吗？')){
            return false;
        }
        hideLayer();
        $.post('{:U('cancel')}', {id:id}, function(data){
            if(data.status == 1){
                updateList();
            }else{
                alert(data.info);
            }
        }, 'json');
    }

</script>
<include file="Public:footer" />
<?php }?>